package Huihu.src.Duoxiancheng;

public class JiOu {
    public static void main(String[] args) {
        Shu shu=new Shu();
        new Thread(shu,"A").start();
        new Thread(shu,"B").start();
    }
}

class Shu implements Runnable{
    private static int i=0;
    @Override
    public void run() {
        while (true){
            i++;
            if (i%2==0){
                System.out.println(Thread.currentThread().getName()+"偶数"+i);
            }
            else{
                System.out.println(Thread.currentThread().getName()+"奇数"+i);
            }
            if (i==50){
                break;
            }
        }
    }
}
